package com.cjr.mq.simple;

import com.cjr.mq.config.QueueConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SendMsg {
    @Autowired
    AmqpTemplate amqpTemplate;

    /*//发送消息
    public void send(String msgContent){
        amqpTemplate.convertAndSend(QueueConfig.FANOUT_EXCHANGE,null,msgContent);
    }*/

    public void send(String msgContent){
        amqpTemplate.convertAndSend(QueueConfig.TOPIC_EXCHANGE,"topic.msg.a",msgContent);
    }
}

